package cn.nexd.app.guestsystem.ui;

import android.app.Activity;
import android.os.Bundle;

import cn.nexd.app.guestsystem.presenter.BasePresenter;
import cn.nexd.framework.util.Logger;

/**
 * Created by wangxu on 16/8/29.
 */
public abstract class BaseActivity<T extends BasePresenter> extends Activity {

    private static final String TAG = "BaseActivity";

    protected T presenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Logger.debug(TAG, "onCreate");
        setContentView(getLayoutResId());
        initPresenter();
    }

    public abstract void initPresenter();

    public abstract int getLayoutResId();

    @Override
    protected void onStart() {
        super.onStart();
        Logger.debug(TAG, "onStart");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Logger.debug(TAG, "onResume");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Logger.debug(TAG, "onPause");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Logger.debug(TAG, "onStop");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Logger.debug(TAG, "onDestory");
    }
}
